static char *
gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
- GAppInfo *info,
- GList *files)
+ GAppInfo *info,
+ GList *files)
{
return NULL;
}
static void
-gdk_wayland_app_launch_context_launch_failed (GAppLaunchContext *context,
- const char *startup_notify_id)
+gdk_wayland_app_launch_context_launch_failed (GAppLaunchContext *context,
+ const char *startup_notify_id)
{
}
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#include "config.h"
}
static gboolean
-set_cursor_from_theme (GdkWaylandCursor *cursor, struct wl_cursor_theme *theme)
+set_cursor_from_theme (GdkWaylandCursor *cursor,
+ struct wl_cursor_theme *theme)
{
struct wl_cursor *c;
* the default cursor
*/
if (!cursor)
- {
- /* FIXME: Is this the best sensible default ? */
- cursor = _gdk_wayland_display_get_cursor_for_type (device->display,
- GDK_LEFT_PTR);
- }
+ cursor = _gdk_wayland_display_get_cursor_for_type (device->display, GDK_LEFT_PTR);
if (cursor == wd->cursor)
return;
static void
get_coordinates (GdkWaylandDeviceData *data,
- double *x, double *y,
- double *x_root, double *y_root)
+ double *x,
+ double *y,
+ double *x_root,
+ double *y_root)
{
int root_x, root_y;
else
{
/* Device is a pointer */
-
if (wayland_device->pointer_grab_window != NULL &&
time_ != 0 && wayland_device->pointer_grab_time > time_)
{
* gdk_wayland_device_get_wl_seat:
* @device: (type GdkWaylandDevice): a #GdkDevice
*
- * Returns the Wayland wl_seat of a #GdkDevice
+ * Returns the Wayland wl_seat of a #GdkDevice.
*
* Returns: (transfer none): a Wayland wl_seat
*
struct wl_seat *
gdk_wayland_device_get_wl_seat (GdkDevice *device)
{
- g_return_val_if_fail(GDK_IS_WAYLAND_DEVICE (device), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (device), NULL);
return GDK_WAYLAND_DEVICE (device)->device->wl_seat;
}
* gdk_wayland_device_get_wl_pointer:
* @device: (type GdkWaylandDevice): a #GdkDevice
*
- * Returns the Wayland wl_pointer of a #GdkDevice
+ * Returns the Wayland wl_pointer of a #GdkDevice.
*
* Returns: (transfer none): a Wayland wl_pointer
*
struct wl_pointer *
gdk_wayland_device_get_wl_pointer (GdkDevice *device)
{
- g_return_val_if_fail(GDK_IS_WAYLAND_DEVICE (device), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (device), NULL);
return GDK_WAYLAND_DEVICE (device)->device->wl_pointer;
}
* gdk_wayland_device_get_wl_keyboard:
* @device: (type GdkWaylandDevice): a #GdkDevice
*
- * Returns the Wayland wl_keyboard of a #GdkDevice
+ * Returns the Wayland wl_keyboard of a #GdkDevice.
*
* Returns: (transfer none): a Wayland wl_keyboard
*
struct wl_keyboard *
gdk_wayland_device_get_wl_keyboard (GdkDevice *device)
{
- g_return_val_if_fail(GDK_IS_WAYLAND_DEVICE (device), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (device), NULL);
return GDK_WAYLAND_DEVICE (device)->device->wl_keyboard;
}
if (!surface)
return;
+
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
return;
{
GdkWaylandDeviceData *device = data;
GdkEvent *event;
- GdkWaylandDisplay *wayland_display =
- GDK_WAYLAND_DISPLAY (device->display);
+ GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (device->display);
if (!surface)
return;
+
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
return;
+
if (!device->pointer_focus)
return;
g_message ("leave, device %p surface %p",
device, device->pointer_focus));
- g_object_unref(device->pointer_focus);
+ g_object_unref (device->pointer_focus);
if (device->cursor)
gdk_wayland_device_stop_window_cursor_animation (device);
GdkEvent *event;
uint32_t modifier;
int gdk_button;
- GdkWaylandDisplay *wayland_display =
- GDK_WAYLAND_DISPLAY (device->display);
if (!device->pointer_focus)
return;
- _gdk_wayland_display_update_serial (wayland_display, serial);
+ _gdk_wayland_display_update_serial (display, serial);
- switch (button) {
- case 273:
- gdk_button = 3;
- break;
- case 274:
- gdk_button = 2;
- break;
- default:
- gdk_button = button - 271;
- break;
- }
+ switch (button)
+ {
+ case 273:
+ gdk_button = 3;
+ break;
+ case 274:
+ gdk_button = 2;
+ break;
+ default:
+ gdk_button = button - 271;
+ break;
+ }
device->time = time;
if (state)
return;
/* get the delta and convert it into the expected range */
- switch (axis) {
- case WL_POINTER_AXIS_VERTICAL_SCROLL:
- delta_x = 0;
- delta_y = wl_fixed_to_double (value) / 10.0;
- break;
- case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
- delta_x = wl_fixed_to_double (value) / 10.0;
- delta_y = 0;
- break;
- default:
- g_return_if_reached ();
- }
+ switch (axis)
+ {
+ case WL_POINTER_AXIS_VERTICAL_SCROLL:
+ delta_x = 0;
+ delta_y = wl_fixed_to_double (value) / 10.0;
+ break;
+ case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
+ delta_x = wl_fixed_to_double (value) / 10.0;
+ delta_y = 0;
+ break;
+ default:
+ g_return_if_reached ();
+ }
device->time = time;
event = gdk_event_new (GDK_SCROLL);
{
GdkWaylandDeviceData *device = data;
GdkEvent *event;
- GdkWaylandDisplay *wayland_display =
- GDK_WAYLAND_DISPLAY (device->display);
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
if (!surface)
return;
+
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
return;
- _gdk_wayland_display_update_serial (wayland_display, serial);
+ _gdk_wayland_display_update_serial (display, serial);
- device->keyboard_focus = wl_surface_get_user_data(surface);
- g_object_ref(device->keyboard_focus);
+ device->keyboard_focus = wl_surface_get_user_data (surface);
+ g_object_ref (device->keyboard_focus);
event = gdk_event_new (GDK_FOCUS_CHANGE);
event->focus_change.window = g_object_ref (device->keyboard_focus);
{
GdkWaylandDeviceData *device = data;
GdkEvent *event;
- GdkWaylandDisplay *wayland_display =
- GDK_WAYLAND_DISPLAY (device->display);
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
if (!surface)
return;
+
if (!GDK_IS_WINDOW (wl_surface_get_user_data (surface)))
return;
+
if (!device->keyboard_focus)
return;
- _gdk_wayland_display_update_serial (wayland_display, serial);
+ _gdk_wayland_display_update_serial (display, serial);
event = gdk_event_new (GDK_FOCUS_CHANGE);
event->focus_change.window = g_object_ref (device->keyboard_focus);
gdk_event_set_device (event, device->master_keyboard);
gdk_event_set_source_device (event, device->keyboard);
- g_object_unref(device->keyboard_focus);
+ g_object_unref (device->keyboard_focus);
device->keyboard_focus = NULL;
GDK_NOTE (EVENTS,
_gdk_wayland_display_deliver_event (device->display, event);
}
-static gboolean
-keyboard_repeat (gpointer data);
+static gboolean keyboard_repeat (gpointer data);
static void
translate_keyboard_string (GdkEventKey *event)
gsize bytes_written;
gint len;
- /* Apply the control key - Taken from Xlib
- */
+ /* Apply the control key - Taken from Xlib */
if (event->state & GDK_CONTROL_MASK)
{
- if ((c >= '@' && c < '\177') || c == ' ') c &= 0x1F;
+ if ((c >= '@' && c < '\177') || c == ' ')
+ c &= 0x1F;
else if (c == '2')
{
event->string = g_memdup ("\0\0", 2);
buf[0] = '\0';
return;
}
- else if (c >= '3' && c <= '7') c -= ('3' - '\033');
- else if (c == '8') c = '\177';
- else if (c == '/') c = '_' & 0x1F;
+ else if (c >= '3' && c <= '7')
+ c -= ('3' - '\033');
+ else if (c == '8')
+ c = '\177';
+ else if (c == '/')
+ c = '_' & 0x1F;
}
len = g_unichar_to_utf8 (c, buf);
g_source_remove (device->repeat_timer);
device->repeat_timer = 0;
}
-
device->repeat_timer =
gdk_threads_add_timeout (delay, keyboard_repeat, device);
g_source_set_name_by_id (device->repeat_timer, "[gtk+] keyboard_repeat");
uint32_t state_w)
{
GdkWaylandDeviceData *device = data;
- GdkWaylandDisplay *wayland_display =
- GDK_WAYLAND_DISPLAY (device->display);
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
if (!device->keyboard_focus)
return;
device->repeat_count = 0;
- _gdk_wayland_display_update_serial (wayland_display, serial);
+ _gdk_wayland_display_update_serial (display, serial);
deliver_key_event (data, time, key + 8, state_w);
}
wl_fixed_t y)
{
GdkWaylandDeviceData *device = data;
- GdkWaylandDisplay *wayland_display =
- GDK_WAYLAND_DISPLAY (device->display);
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
GdkWaylandTouchData *touch;
GdkEvent *event;
- _gdk_wayland_display_update_serial (wayland_display, serial);
+ _gdk_wayland_display_update_serial (display, serial);
touch = gdk_wayland_device_add_touch (device, id, wl_surface);
touch->x = wl_fixed_to_double (x);
int32_t id)
{
GdkWaylandDeviceData *device = data;
- GdkWaylandDisplay *wayland_display =
- GDK_WAYLAND_DISPLAY (device->display);
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (device->display);
GdkWaylandTouchData *touch;
GdkEvent *event;
- _gdk_wayland_display_update_serial (wayland_display, serial);
+ _gdk_wayland_display_update_serial (display, serial);
touch = gdk_wayland_device_get_touch (device, id);
event = _create_touch_event (device, touch, GDK_TOUCH_END, time);
enum wl_seat_capability caps)
{
GdkWaylandDeviceData *device = data;
- GdkWaylandDeviceManager *device_manager =
- GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
+ GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
if ((caps & WL_SEAT_CAPABILITY_POINTER) && !device->wl_pointer)
{
}
static void
-seat_handle_name (void *data,
- struct wl_seat *seat,
- const char *name)
+seat_handle_name (void *data,
+ struct wl_seat *seat,
+ const char *name)
{
/* We don't care about the name. */
}
static void
init_devices (GdkWaylandDeviceData *device)
{
- GdkWaylandDeviceManager *device_manager =
- GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
+ GdkWaylandDeviceManager *device_manager = GDK_WAYLAND_DEVICE_MANAGER (device->device_manager);
/* pointer */
device->master_pointer = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
GdkWaylandDeviceManager *wayland_device_manager;
GList *devices = NULL, *l;
- wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
+ wayland_device_manager = GDK_WAYLAND_DEVICE_MANAGER (device_manager);
for (l = wayland_device_manager->devices; l; l = l->next)
{
GdkWaylandDeviceManager *wayland_device_manager;
GList *l;
- wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
+ wayland_device_manager = GDK_WAYLAND_DEVICE_MANAGER (device_manager);
/* Find the first master pointer device */
for (l = wayland_device_manager->devices; l != NULL; l = l->next)
GdkWaylandDeviceData *device;
g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device));
+
device = GDK_WAYLAND_DEVICE (gdk_device)->device;
gdk_wayland_device_remove_touch (device, GDK_EVENT_SEQUENCE_TO_SLOT (sequence));
struct wl_data_device *
gdk_wayland_device_get_data_device (GdkDevice *gdk_device)
{
- GdkWaylandDeviceData *device;
-
g_return_val_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device), NULL);
- device = GDK_WAYLAND_DEVICE (gdk_device)->device;
- return device->data_device;
+ return GDK_WAYLAND_DEVICE (gdk_device)->device->data_device;
}
void
GdkWaylandDisplay *display_wayland;
g_return_if_fail (GDK_IS_WAYLAND_DEVICE (gdk_device));
+
device = GDK_WAYLAND_DEVICE (gdk_device)->device;
display_wayland = GDK_WAYLAND_DISPLAY (gdk_device_get_display (gdk_device));
};
static void
-gdk_registry_handle_global(void *data, struct wl_registry *registry, uint32_t id,
- const char *interface, uint32_t version)
+gdk_registry_handle_global (void *data,
+ struct wl_registry *registry,
+ uint32_t id,
+ const char *interface,
+ uint32_t version)
{
GdkWaylandDisplay *display_wayland = data;
GdkDisplay *gdk_display = GDK_DISPLAY_OBJECT (data);
struct wl_seat *seat;
struct wl_output *output;
- if (strcmp(interface, "wl_compositor") == 0) {
- display_wayland->compositor =
- wl_registry_bind(display_wayland->wl_registry, id, &wl_compositor_interface, MIN (version, 3));
- display_wayland->compositor_version = MIN (version, 3);
- } else if (strcmp(interface, "wl_shm") == 0) {
- display_wayland->shm =
- wl_registry_bind(display_wayland->wl_registry, id, &wl_shm_interface, 1);
-
- /* SHM interface is prerequisite */
- _gdk_wayland_display_load_cursor_theme(display_wayland);
- } else if (strcmp(interface, "xdg_shell") == 0) {
- display_wayland->xdg_shell =
- wl_registry_bind(display_wayland->wl_registry, id, &xdg_shell_interface, 1);
- xdg_shell_use_unstable_version(display_wayland->xdg_shell, XDG_SHELL_VERSION_CURRENT);
- xdg_shell_add_listener(display_wayland->xdg_shell, &xdg_shell_listener, display_wayland);
- } else if (strcmp(interface, "gtk_shell") == 0) {
- display_wayland->gtk_shell =
- wl_registry_bind(display_wayland->wl_registry, id, >k_shell_interface, 1);
- _gdk_wayland_screen_set_has_gtk_shell (display_wayland->screen);
- } else if (strcmp(interface, "wl_output") == 0) {
- output =
- wl_registry_bind(display_wayland->wl_registry, id, &wl_output_interface, MIN (version, 2));
- _gdk_wayland_screen_add_output(display_wayland->screen, id, output, MIN (version, 2));
- } else if (strcmp(interface, "wl_seat") == 0) {
- seat = wl_registry_bind(display_wayland->wl_registry, id, &wl_seat_interface, MIN (version, 4));
- _gdk_wayland_device_manager_add_seat (gdk_display->device_manager, id, seat);
- } else if (strcmp(interface, "wl_data_device_manager") == 0) {
+ if (strcmp (interface, "wl_compositor") == 0)
+ {
+ display_wayland->compositor =
+ wl_registry_bind (display_wayland->wl_registry, id, &wl_compositor_interface, MIN (version, 3));
+ display_wayland->compositor_version = MIN (version, 3);
+ }
+ else if (strcmp (interface, "wl_shm") == 0)
+ {
+ display_wayland->shm =
+ wl_registry_bind (display_wayland->wl_registry, id, &wl_shm_interface, 1);
+
+ /* SHM interface is prerequisite */
+ _gdk_wayland_display_load_cursor_theme (display_wayland);
+ }
+ else if (strcmp (interface, "xdg_shell") == 0)
+ {
+ display_wayland->xdg_shell =
+ wl_registry_bind (display_wayland->wl_registry, id, &xdg_shell_interface, 1);
+ xdg_shell_use_unstable_version (display_wayland->xdg_shell, XDG_SHELL_VERSION_CURRENT);
+ xdg_shell_add_listener (display_wayland->xdg_shell, &xdg_shell_listener, display_wayland);
+ }
+ else if (strcmp (interface, "gtk_shell") == 0)
+ {
+ display_wayland->gtk_shell =
+ wl_registry_bind (display_wayland->wl_registry, id, >k_shell_interface, 1);
+ _gdk_wayland_screen_set_has_gtk_shell (display_wayland->screen);
+ }
+ else if (strcmp (interface, "wl_output") == 0)
+ {
+ output =
+ wl_registry_bind (display_wayland->wl_registry, id, &wl_output_interface, MIN (version, 2));
+ _gdk_wayland_screen_add_output (display_wayland->screen, id, output, MIN (version, 2));
+ }
+ else if (strcmp (interface, "wl_seat") == 0)
+ {
+ seat = wl_registry_bind (display_wayland->wl_registry, id, &wl_seat_interface, MIN (version, 4));
+ _gdk_wayland_device_manager_add_seat (gdk_display->device_manager, id, seat);
+ }
+ else if (strcmp (interface, "wl_data_device_manager") == 0)
+ {
display_wayland->data_device_manager =
- wl_registry_bind(display_wayland->wl_registry, id,
- &wl_data_device_manager_interface, 1);
- } else if (strcmp (interface, "wl_subcompositor") == 0) {
- display_wayland->subcompositor =
- wl_registry_bind (display_wayland->wl_registry, id,
- &wl_subcompositor_interface, 1);
- }
+ wl_registry_bind (display_wayland->wl_registry, id, &wl_data_device_manager_interface, 1);
+ }
+ else if (strcmp (interface, "wl_subcompositor") == 0)
+ {
+ display_wayland->subcompositor =
+ wl_registry_bind (display_wayland->wl_registry, id, &wl_subcompositor_interface, 1);
+ }
}
static void
-gdk_registry_handle_global_remove(void *data,
- struct wl_registry *registry,
- uint32_t id)
+gdk_registry_handle_global_remove (void *data,
+ struct wl_registry *registry,
+ uint32_t id)
{
GdkWaylandDisplay *display_wayland = data;
GdkDisplay *display = GDK_DISPLAY (display_wayland);
};
static void
-log_handler(const char *format, va_list args)
+log_handler (const char *format, va_list args)
{
g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, args);
}
if (g_getenv ("XDG_RUNTIME_DIR") == NULL)
return NULL;
- wl_log_set_handler_client(log_handler);
+ wl_log_set_handler_client (log_handler);
- wl_display = wl_display_connect(display_name);
+ wl_display = wl_display_connect (display_name);
if (!wl_display)
return NULL;
display_wayland->event_source = _gdk_wayland_display_event_source_new (display);
_gdk_wayland_display_init_cursors (display_wayland);
- display_wayland->wl_registry = wl_display_get_registry(display_wayland->wl_display);
- wl_registry_add_listener(display_wayland->wl_registry, ®istry_listener, display_wayland);
+ display_wayland->wl_registry = wl_display_get_registry (display_wayland->wl_display);
+ wl_registry_add_listener (display_wayland->wl_registry, ®istry_listener, display_wayland);
/* Wait until the dust has settled during init... */
wl_display_roundtrip (display_wayland->wl_display);
display_wayland = GDK_WAYLAND_DISPLAY (display);
- wl_display_roundtrip(display_wayland->wl_display);
+ wl_display_roundtrip (display_wayland->wl_display);
}
static void
g_return_if_fail (GDK_IS_DISPLAY (display));
if (!display->closed)
- wl_display_flush(GDK_WAYLAND_DISPLAY (display)->wl_display);
+ wl_display_flush (GDK_WAYLAND_DISPLAY (display)->wl_display);
}
static gboolean
}
static void
-gdk_wayland_display_class_init (GdkWaylandDisplayClass * class)
+gdk_wayland_display_class_init (GdkWaylandDisplayClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
GdkDisplayClass *display_class = GDK_DISPLAY_CLASS (class);
else
name = "default";
- gdk_wayland_display_set_cursor_theme (GDK_DISPLAY (wayland_display),
- name, size);
+ gdk_wayland_display_set_cursor_theme (GDK_DISPLAY (wayland_display), name, size);
g_value_unset (&v);
}
}
/**
- * gdk_wayland_display_get_wl_display
+ * gdk_wayland_display_get_wl_display:
* @display: (type GdkWaylandDisplay): a #GdkDisplay
*
- * Returns the Wayland wl_display of a #GdkDisplay
+ * Returns the Wayland wl_display of a #GdkDisplay.
*
* Returns: (transfer none): a Wayland wl_display
*
* Since: 3.8
*/
struct wl_display *
-gdk_wayland_display_get_wl_display(GdkDisplay *display)
+gdk_wayland_display_get_wl_display (GdkDisplay *display)
{
- GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
-
- g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY(display), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), NULL);
- return wayland_display->wl_display;
+ return GDK_WAYLAND_DISPLAY (display)->wl_display;
}
/**
- * gdk_wayland_display_get_wl_compositor
+ * gdk_wayland_display_get_wl_compositor:
* @display: (type GdkWaylandDisplay): a #GdkDisplay
*
- * Returns the Wayland global singleton compositor of a #GdkDisplay
+ * Returns the Wayland global singleton compositor of a #GdkDisplay.
*
* Returns: (transfer none): a Wayland wl_compositor
*
struct wl_compositor *
gdk_wayland_display_get_wl_compositor (GdkDisplay *display)
{
- GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
+ g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), NULL);
- g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY(display), NULL);
-
- return wayland_display->compositor;
+ return GDK_WAYLAND_DISPLAY (display)->compositor;
}
/**
- * gdk_wayland_display_get_xdg_shell
+ * gdk_wayland_display_get_xdg_shell:
* @display: (type GdkWaylandDisplay): a #GdkDisplay
*
- * Returns the Wayland global singleton shell of a #GdkDisplay
+ * Returns the Wayland global singleton shell of a #GdkDisplay.
*
* Returns: (transfer none): a Wayland xdg_shell
*
struct xdg_shell *
gdk_wayland_display_get_xdg_shell (GdkDisplay *display)
{
- GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
-
- g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY(display), NULL);
+ g_return_val_if_fail (GDK_IS_WAYLAND_DISPLAY (display), NULL);
- return wayland_display->xdg_shell;
+ return GDK_WAYLAND_DISPLAY (display)->xdg_shell;
}
static const cairo_user_data_key_t gdk_wayland_cairo_key;
return NULL;
}
- pool = wl_shm_create_pool(shm, fd, size);
+ pool = wl_shm_create_pool (shm, fd, size);
close (fd);
/*
* gdkdisplay-wayland.h
- *
- * Copyright 2001 Sun Microsystems Inc.
+ *
+ * Copyright 2001 Sun Microsystems Inc.
*
* Erwann Chenede <erwann.chenede@sun.com>
*
G_END_DECLS
-#endif /* __GDK_WAYLAND_DISPLAY__ */
+#endif /* __GDK_WAYLAND_DISPLAY__ */
static GList *event_sources = NULL;
static gboolean
-gdk_event_source_prepare(GSource *base, gint *timeout)
+gdk_event_source_prepare (GSource *base,
+ gint *timeout)
{
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
GdkWaylandDisplay *display = (GdkWaylandDisplay *) source->display;
}
static gboolean
-gdk_event_source_check(GSource *base)
+gdk_event_source_check (GSource *base)
{
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
}
static gboolean
-gdk_event_source_dispatch(GSource *base,
- GSourceFunc callback,
- gpointer data)
+gdk_event_source_dispatch (GSource *base,
+ GSourceFunc callback,
+ gpointer data)
{
GdkWaylandEventSource *source = (GdkWaylandEventSource *) base;
GdkDisplay *display = source->display;
};
void
-_gdk_wayland_display_deliver_event (GdkDisplay *display, GdkEvent *event)
+_gdk_wayland_display_deliver_event (GdkDisplay *display,
+ GdkEvent *event)
{
GList *node;
window_rect.height = gdk_window_get_height (window);
/* If nothing else is known, repaint everything so that the back
- buffer is fully up-to-date for the swapbuffer */
+ * buffer is fully up-to-date for the swapbuffer
+ */
cairo_region_union_rectangle (update_area, &window_rect);
}
}
}
static void
-gdk_wayland_gl_context_end_frame (GdkGLContext *context,
+gdk_wayland_gl_context_end_frame (GdkGLContext *context,
cairo_region_t *painted,
cairo_region_t *damage)
{
egl_surface = gdk_wayland_window_get_egl_surface (window->impl_window,
context_wayland->egl_config);
- // TODO: Use eglSwapBuffersWithDamageEXT if available
+ /* TODO: Use eglSwapBuffersWithDamageEXT if available */
if (display_wayland->have_egl_swap_buffers_with_damage)
{
int i, j, n_rects = cairo_region_num_rectangles (damage);
if (state & GDK_MOD1_MASK)
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT);
if (state & GDK_MOD2_MASK)
- mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod2");
+ mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_NUM);
if (state & GDK_MOD3_MASK)
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod3");
if (state & GDK_MOD4_MASK)
state |= GDK_CONTROL_MASK;
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT)))
state |= GDK_MOD1_MASK;
- if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod2")))
+ if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_NUM)))
state |= GDK_MOD2_MASK;
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod3")))
state |= GDK_MOD3_MASK;
}
GdkKeymap *
-_gdk_wayland_keymap_new ()
+_gdk_wayland_keymap_new (void)
{
GdkWaylandKeymap *keymap;
struct xkb_context *context;
context = xkb_context_new (0);
- map_str = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0);
+ map_str = mmap (NULL, size, PROT_READ, MAP_SHARED, fd, 0);
if (map_str == MAP_FAILED)
{
close(fd);
return;
- }
+ }
xkb_keymap = xkb_keymap_new_from_string (context, map_str, format, 0);
munmap (map_str, size);
update_direction (keymap_wayland);
}
-struct xkb_keymap *_gdk_wayland_keymap_get_xkb_keymap (GdkKeymap *keymap)
+struct xkb_keymap *
+_gdk_wayland_keymap_get_xkb_keymap (GdkKeymap *keymap)
{
return GDK_WAYLAND_KEYMAP (keymap)->xkb_keymap;
}
-struct xkb_state *_gdk_wayland_keymap_get_xkb_state (GdkKeymap *keymap)
+struct xkb_state *
+_gdk_wayland_keymap_get_xkb_state (GdkKeymap *keymap)
{
return GDK_WAYLAND_KEYMAP (keymap)->xkb_state;
}
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
/*
- * Private uninstalled header defining things local to X windowing code
+ * Private uninstalled header defining things local to the Wayland backend
*/
#ifndef __GDK_PRIVATE_WAYLAND_H__
gint monitor_num)
{
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
- GdkWaylandMonitor *monitor = g_ptr_array_index(screen_wayland->monitors, monitor_num);
+ GdkWaylandMonitor *monitor;
+
+ monitor = g_ptr_array_index (screen_wayland->monitors, monitor_num);
return monitor->width_mm;
}
gint monitor_num)
{
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
- GdkWaylandMonitor *monitor = g_ptr_array_index(screen_wayland->monitors, monitor_num);
+ GdkWaylandMonitor *monitor;
+
+ monitor = g_ptr_array_index (screen_wayland->monitors, monitor_num);
return monitor->height_mm;
}
gint monitor_num)
{
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
- GdkWaylandMonitor *monitor = g_ptr_array_index(screen_wayland->monitors, monitor_num);
+ GdkWaylandMonitor *monitor;
+
+ monitor = g_ptr_array_index (screen_wayland->monitors, monitor_num);
return g_strdup (monitor->output_name);
}
GdkRectangle *dest)
{
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
- GdkWaylandMonitor *monitor = g_ptr_array_index(screen_wayland->monitors, monitor_num);
+ GdkWaylandMonitor *monitor;
+
+ monitor = g_ptr_array_index (screen_wayland->monitors, monitor_num);
if (dest)
*dest = monitor->geometry;
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
GdkWaylandMonitor *monitor;
- if (monitor_num >= screen_wayland->monitors->len)
- return 1;
-
- monitor = g_ptr_array_index(screen_wayland->monitors, monitor_num);
+ monitor = g_ptr_array_index (screen_wayland->monitors, monitor_num);
return monitor->scale;
}
static gdouble
get_dpi_from_gsettings (GdkWaylandScreen *screen_wayland)
{
- GSettings *interface_settings;
- gdouble factor;
+ GSettings *settings;
+ gdouble factor;
- interface_settings = g_hash_table_lookup (screen_wayland->settings,
- "org.gnome.desktop.interface");
- if (interface_settings != NULL)
- factor = g_settings_get_double (interface_settings, "text-scaling-factor");
- else
- factor = 1.0;
+ settings = g_hash_table_lookup (screen_wayland->settings,
+ "org.gnome.desktop.interface");
+ if (settings != NULL)
+ factor = g_settings_get_double (settings, "text-scaling-factor");
+ else
+ factor = 1.0;
- return 96.0 * factor;
+ return 96.0 * factor;
}
static void
};
static TranslationEntry *
-find_translation_entry_by_key (GSettings *settings, const gchar *key)
+find_translation_entry_by_key (GSettings *settings,
+ const gchar *key)
{
guint i;
gchar *schema;
static gboolean
set_capability_setting (GdkScreen *screen,
- GValue *value,
- enum gtk_shell_capability test)
+ GValue *value,
+ enum gtk_shell_capability test)
{
GdkWaylandScreen *wayland_screen = GDK_WAYLAND_SCREEN (screen);
static gboolean
gdk_wayland_screen_get_setting (GdkScreen *screen,
- const gchar *name,
- GValue *value)
+ const gchar *name,
+ GValue *value)
{
TranslationEntry *entry;
}
static void
-output_handle_geometry(void *data,
- struct wl_output *wl_output,
- int x, int y, int physical_width, int physical_height,
- int subpixel, const char *make, const char *model,
- int32_t transform)
+output_handle_geometry (void *data,
+ struct wl_output *wl_output,
+ int x,
+ int y,
+ int physical_width,
+ int physical_height,
+ int subpixel,
+ const char *make,
+ const char *model,
+ int32_t transform)
{
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
}
static void
-output_handle_done(void *data,
- struct wl_output *wl_output)
+output_handle_done (void *data,
+ struct wl_output *wl_output)
{
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
}
static void
-output_handle_scale(void *data,
- struct wl_output *wl_output,
- int32_t factor)
+output_handle_scale (void *data,
+ struct wl_output *wl_output,
+ int32_t factor)
{
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
}
static void
-output_handle_mode(void *data,
- struct wl_output *wl_output,
- uint32_t flags,
- int width,
- int height,
- int refresh)
+output_handle_mode (void *data,
+ struct wl_output *wl_output,
+ uint32_t flags,
+ int width,
+ int height,
+ int refresh)
{
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
guint32 version)
{
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
- GdkWaylandMonitor *monitor = g_new0(GdkWaylandMonitor, 1);
+ GdkWaylandMonitor *monitor;
+
+ monitor = g_new0 (GdkWaylandMonitor, 1);
monitor->id = id;
monitor->output = output;
monitor->version = version;
monitor->screen = screen_wayland;
monitor->scale = 1;
- g_ptr_array_add(screen_wayland->monitors, monitor);
- wl_output_add_listener(output, &output_listener, monitor);
+ g_ptr_array_add (screen_wayland->monitors, monitor);
+
+ wl_output_add_listener (output, &output_listener, monitor);
}
void
GdkAtom selection;
};
-struct _AsyncWriteData {
+struct _AsyncWriteData
+{
GOutputStream *stream;
GdkWaylandSelection *selection;
gsize index;
atoms[ATOM_DND] = gdk_atom_intern_static_string ("GdkWaylandSelection");
selection = g_new0 (GdkWaylandSelection, 1);
- selection->selection_buffers = g_hash_table_new_full (NULL, NULL, NULL,
- (GDestroyNotify) selection_buffer_cancel_and_unref);
+ selection->selection_buffers =
+ g_hash_table_new_full (NULL, NULL, NULL,
+ (GDestroyNotify) selection_buffer_cancel_and_unref);
return selection;
}
}
void
-gdk_wayland_selection_unset_data_source (GdkDisplay *display, GdkAtom selection)
+gdk_wayland_selection_unset_data_source (GdkDisplay *display,
+ GdkAtom selection)
{
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
GdkWindow *
_gdk_wayland_display_get_selection_owner (GdkDisplay *display,
- GdkAtom selection)
+ GdkAtom selection)
{
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
gboolean
_gdk_wayland_display_set_selection_owner (GdkDisplay *display,
- GdkWindow *owner,
- GdkAtom selection,
- guint32 time,
- gboolean send_event)
+ GdkWindow *owner,
+ GdkAtom selection,
+ guint32 time,
+ gboolean send_event)
{
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
void
_gdk_wayland_display_send_selection_notify (GdkDisplay *dispay,
- GdkWindow *requestor,
- GdkAtom selection,
- GdkAtom target,
- GdkAtom property,
- guint32 time)
+ GdkWindow *requestor,
+ GdkAtom selection,
+ GdkAtom target,
+ GdkAtom property,
+ guint32 time)
{
}
gint
_gdk_wayland_display_get_selection_property (GdkDisplay *display,
- GdkWindow *requestor,
- guchar **data,
- GdkAtom *ret_type,
- gint *ret_format)
+ GdkWindow *requestor,
+ guchar **data,
+ GdkAtom *ret_type,
+ gint *ret_format)
{
SelectionBuffer *buffer_data;
gsize len;
void
_gdk_wayland_display_convert_selection (GdkDisplay *display,
- GdkWindow *requestor,
- GdkAtom selection,
- GdkAtom target,
- guint32 time)
+ GdkWindow *requestor,
+ GdkAtom selection,
+ GdkAtom target,
+ guint32 time)
{
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
SelectionBuffer *buffer_data;
gint
_gdk_wayland_display_text_property_to_utf8_list (GdkDisplay *display,
- GdkAtom encoding,
- gint format,
- const guchar *text,
- gint length,
- gchar ***list)
+ GdkAtom encoding,
+ gint format,
+ const guchar *text,
+ gint length,
+ gchar ***list)
{
GPtrArray *array;
const gchar *ptr;
gchar *
_gdk_wayland_display_utf8_to_string_target (GdkDisplay *display,
- const gchar *str)
+ const gchar *str)
{
return NULL;
}
}
void
-gdk_wayland_selection_clear_targets (GdkDisplay *display, GdkAtom selection)
+gdk_wayland_selection_clear_targets (GdkDisplay *display,
+ GdkAtom selection)
{
gdk_wayland_selection_unset_data_source (display, selection);
}
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GDK_WAYLAND_H__
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
#ifndef __GDK_WAYLAND_SELECTION_H__
typedef struct _GdkWaylandWindow GdkWaylandWindow;
typedef struct _GdkWaylandWindowClass GdkWaylandWindowClass;
-struct _GdkWaylandWindow {
+struct _GdkWaylandWindow
+{
GdkWindow parent;
};
-struct _GdkWaylandWindowClass {
+struct _GdkWaylandWindowClass
+{
GdkWindowClass parent_class;
};
impl->wrapper = GDK_WINDOW (window);
if (wayland_display->compositor_version >= WL_SURFACE_HAS_BUFFER_SCALE &&
- gdk_screen_get_n_monitors(screen) > 0)
+ gdk_screen_get_n_monitors (screen) > 0)
impl->scale = gdk_screen_get_monitor_scale_factor (screen, 0);
/* logical 1x1 fake buffer */
- impl->cairo_surface =
- cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
- impl->scale,
- impl->scale);
+ impl->cairo_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
+ impl->scale,
+ impl->scale);
cairo_surface_set_device_scale (impl->cairo_surface, impl->scale, impl->scale);
for (l = impl->outputs; l != NULL; l = l->next)
{
guint32 output_scale =
- _gdk_wayland_screen_get_output_scale (wayland_display->screen,
- l->data);
+ _gdk_wayland_screen_get_output_scale (wayland_display->screen, l->data);
scale = MAX (scale, output_scale);
}
/* Notify app that scale changed */
- gdk_wayland_window_configure (window,
- window->width, window->height,
- scale);
+ gdk_wayland_window_configure (window, window->width, window->height, scale);
}
static void
window->impl = GDK_WINDOW_IMPL (impl);
impl->wrapper = GDK_WINDOW (window);
- if (window->width > 65535 ||
- window->height > 65535)
+ if (window->width > 65535)
{
- g_warning ("Native Windows wider or taller than 65535 pixels are not supported");
-
- if (window->width > 65535)
- window->width = 65535;
- if (window->height > 65535)
- window->height = 65535;
+ g_warning ("Native Windows wider than 65535 pixels are not supported");
+ window->width = 65535;
+ }
+ if (window->height > 65535)
+ {
+ g_warning ("Native Windows taller than 65535 pixels are not supported");
+ window->height = 65535;
}
g_object_ref (window);
gdk_window_impl_wayland_begin_paint (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+
gdk_wayland_window_ensure_cairo_surface (window);
+
if (_gdk_wayland_is_shm_surface (impl->cairo_surface))
return _gdk_wayland_shm_surface_get_busy (impl->cairo_surface);
else
for (i = 0; i < n; i++)
{
cairo_region_get_rectangle (window->current_paint.region, i, &rect);
- wl_surface_damage (impl->surface,
- rect.x, rect.y, rect.width, rect.height);
+ wl_surface_damage (impl->surface, rect.x, rect.y, rect.width, rect.height);
impl->pending_commit = TRUE;
}
}
gdk_wayland_window_configure (window, width, height, impl->scale);
}
- wl_array_for_each(p, states)
+ wl_array_for_each (p, states)
{
uint32_t state = *p;
switch (state)
}
static void
-xdg_surface_close (void *data,
+xdg_surface_close (void *data,
struct xdg_surface *xdg_surface)
{
GdkWindow *window = GDK_WINDOW (data);
}
static void
-gdk_wayland_window_create_xdg_popup (GdkWindow *window,
- GdkWindow *parent,
- struct wl_seat *seat)
+gdk_wayland_window_create_xdg_popup (GdkWindow *window,
+ GdkWindow *parent,
+ struct wl_seat *seat)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkWindowImplWayland *parent_impl = GDK_WINDOW_IMPL_WAYLAND (parent->impl);
GdkDeviceManager *device_manager;
if (!parent_impl->surface)
return;
- device_manager = gdk_display_get_device_manager (GDK_DISPLAY (display_wayland));
+ device_manager = gdk_display_get_device_manager (GDK_DISPLAY (display));
device = GDK_WAYLAND_DEVICE (gdk_device_manager_get_client_pointer (device_manager));
gdk_wayland_window_get_fake_root_coords (parent, &parent_x, &parent_y);
y -= parent_impl->margin_top;
}
- impl->xdg_popup = xdg_shell_get_xdg_popup (display_wayland->xdg_shell,
+ impl->xdg_popup = xdg_shell_get_xdg_popup (display->xdg_shell,
impl->surface,
parent_impl->surface,
seat,
impl->geometry_hints = *geometry;
impl->geometry_mask = geom_mask;
-
- /*
- * GDK_HINT_POS
- * GDK_HINT_USER_POS
- * GDK_HINT_USER_SIZE
- * GDK_HINT_MIN_SIZE
- * GDK_HINT_MAX_SIZE
- * GDK_HINT_BASE_SIZE
- * GDK_HINT_RESIZE_INC
- * GDK_HINT_ASPECT
- * GDK_HINT_WIN_GRAVITY
- */
}
static void
gdk_wayland_window_set_group (GdkWindow *window,
GdkWindow *leader)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
- g_return_if_fail (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD);
- g_return_if_fail (leader == NULL || GDK_IS_WINDOW (leader));
}
static void
}
/**
- * gdk_wayland_window_get_wl_surface
+ * gdk_wayland_window_get_wl_surface:
* @window: (type GdkWaylandWindow): a #GdkWindow
*
- * Returns the Wayland surface of a #GdkWindow
+ * Returns the Wayland surface of a #GdkWindow.
*
* Returns: (transfer none): a Wayland wl_surface
*
struct wl_surface *
gdk_wayland_window_get_wl_surface (GdkWindow *window)
{
- GdkWindowImplWayland *impl;
-
g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL);
- impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
-
- return impl->surface;
+ return GDK_WINDOW_IMPL_WAYLAND (window->impl)->surface;
}
static struct wl_egl_window *
gdk_wayland_window_get_wl_egl_window (GdkWindow *window)
{
- GdkWindowImplWayland *impl;
-
- g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL);
-
- impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
if (impl->egl_window == NULL)
{
impl->egl_window =
- wl_egl_window_create(impl->surface,
- impl->wrapper->width * impl->scale,
- impl->wrapper->height * impl->scale);
+ wl_egl_window_create (impl->surface,
+ impl->wrapper->width * impl->scale,
+ impl->wrapper->height * impl->scale);
wl_surface_set_buffer_scale (impl->surface, impl->scale);
}
EGLSurface
gdk_wayland_window_get_egl_surface (GdkWindow *window,
- EGLConfig config)
+ EGLConfig config)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
GdkWindowImplWayland *impl;
struct wl_egl_window *egl_window;
egl_window = gdk_wayland_window_get_wl_egl_window (window);
impl->egl_surface =
- eglCreateWindowSurface (display_wayland->egl_display,
- config, egl_window, NULL);
+ eglCreateWindowSurface (display->egl_display, config, egl_window, NULL);
}
return impl->egl_surface;
EGLSurface
gdk_wayland_window_get_dummy_egl_surface (GdkWindow *window,
- EGLConfig config)
+ EGLConfig config)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
GdkWindowImplWayland *impl;
g_return_val_if_fail (GDK_IS_WAYLAND_WINDOW (window), NULL);
wl_egl_window_create (impl->surface, 1, 1);
impl->dummy_egl_surface =
- eglCreateWindowSurface (display_wayland->egl_display,
- config, impl->dummy_egl_window, NULL);
+ eglCreateWindowSurface (display->egl_display, config, impl->dummy_egl_window, NULL);
}
return impl->dummy_egl_surface;
const char *application_object_path,
const char *unique_bus_name)
{
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
+ GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
GdkWindowImplWayland *impl;
g_return_if_fail (GDK_IS_WAYLAND_WINDOW (window));
{
if (impl->xdg_surface == NULL)
return;
- if (display_wayland->gtk_shell == NULL)
+
+ if (display->gtk_shell == NULL)
return;
- impl->gtk_surface = gtk_shell_get_gtk_surface (display_wayland->gtk_shell, impl->surface);
+ impl->gtk_surface = gtk_shell_get_gtk_surface (display->gtk_shell, impl->surface);
}
gtk_surface_set_dbus_properties (impl->gtk_surface,